
<div class="row">
	<div class="col-sm-12">
		<div class="panel b-a panel-default">
			<div class="panel-heading clearfix">
				<ul class="nav pull-right nav-tabs " id="tab">
	                <li class="active">
	                  <a data-original-title="" data-toggle="tab" href="#tab1">Users List</a>
	                </li>
	                <li class="">
	                  <a data-original-title="" data-toggle="tab" href="#tab2">Groups List</a>
	                </li>
	                <li class="">
	                  <a data-original-title="" data-toggle="tab" href="#tab3">Association</a>
	                </li>
	            </ul>
			</div>
			<div class="panel-body">
				<div class="tab-content">
					<div id="tab1" class="tab-pane active">
						<table id="grid1"></table>
					</div>
					<div id="tab2" class="tab-pane">
						<table id="grid2"></table>
					</div>
					<div id="tab3" class="tab-pane">
						<table id="grid3"></table>
					</div>
				</div>
			</div>
		</div>
		
	</div>
</div>

<div id="winuser" style="display: none;">
	<div class="m-a-lg">
		<form id="formuser" method="post" class="form-horizontal">
			<input name="user_id" type="hidden" autocomplete="off" />
			<div class="form-group">
				<label class="control-label col-sm-4">Username</label>
				<div class="col-sm-8">
					<input name="username" type="text" class="form-control" autocomplete="off" />
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-sm-4">Password</label>
				<div class="col-sm-8">
					<input name="pass1" type="password" class="form-control" autocomplete="off" />
				</div>
			</div>	
			<div class="form-group">
				<label class="control-label col-sm-4">Re-password</label>
				<div class="col-sm-8">
					<input name="pass2" type="password" class="form-control" autocomplete="off" />
				</div>
			</div>	
			<div class="form-group">
				<label class="control-label col-sm-4">Fullname</label>
				<div class="col-sm-8">
					<input name="fullname" type="text" class="form-control" autocomplete="off" />
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-sm-4">Email Address</label>
				<div class="col-sm-8">
					<input name="email" type="text" class="form-control" autocomplete="off" />
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-sm-4">Active ?</label>
				<div class="col-sm-8">
					<select name="active" class="form-control">
						<option value="1">Yes</option>
						<option value="0">No</option>
					</select>
				</div>
			</div>
		</form>
	</div>
</div>

<div id="wingroup" style="display: none;">
	<div class="m-a-lg">
		<form id="formgroup" method="post" class="form-horizontal">
			<input name="group_id" type="hidden" autocomplete="off" />
			<div class="form-group">
				<label class="control-label col-sm-4">Group Name</label>
				<div class="col-sm-8">
					<input name="name" type="text" class="form-control" autocomplete="off" />
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-sm-4">Group Role</label>
				<div class="col-sm-8">
					<select name="roles" class="form-control">
						<?php foreach($roles as $k => $v): ?>
						<option value="<?= $k ?>"><?= $v ?></option>
						<?php endforeach; ?>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-sm-4">Description</label>
				<div class="col-sm-8">
					<textarea name="description" class="form-control"></textarea>
				</div>
			</div>

		</form>
	</div>
</div>

<div id="winassoc" style="display: none;">
	<div class="m-a-lg">
		<form id="formassoc" method="post" class="form-horizontal">
			<input name="user_id" type="hidden" autocomplete="off" />
			<div class="form-group">
				<label class="control-label col-sm-4">User (Fullname)</label>
				<div class="col-sm-8">
					<input name="fullname" disabled type="text" class="form-control" autocomplete="off" />
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-sm-4">Group Name</label>
				<div class="col-sm-8">
					<select name="group_id" class="form-control">
						<?php if(count($groups) > 0): foreach($groups as $g): ?>
						<option value="<?= $g->group_id ?>"><?= $g->name ?></option>
						<?php endforeach; endif; ?>
					</select>
				</div>
			</div>
		</form>
	</div>
</div>